<%	
set conn = nothing
set rs = nothing
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "eBLe"
set rs=Server.CreateObject("adodb.Recordset")

RS.OPEN "SELECT * FROM CLIENTES WHERE LEN(CODIGO)=2 ORDER BY CODIGO",CONN
'RS.OPEN "SELECT * FROM PEDIDOS WHERE LEN(CLIENTE)=2 ORDER BY CLIENTE",CONN

DO WHILE NOT RS.EOF
 COD = RS("CODIGO")
' COD = RS("Cliente")
 RESPONSE.WRITE "- CODIGO :" & COD & ":<BR>"
 IF LEN(COD)>0 THEN
	sql="UPDATE clientes set  "
	sql=sql & " CODIGO = '0" & COD & "' "
	sql=sql & " WHERE CODIGO = '" & COD & "' "
 RESPONSE.WRITE " sql {" & sql & "}<BR>"

'  Set RSe = conn.execute(sql)
 END IF
 RS.MOVENEXT
LOOP

rs.close

%>

